/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 threat_footprint.h

	$Header: /heroes4/threat_footprint.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( THREAT_FOOTPRINT_H_INCLUDED )
#define THREAT_FOOTPRINT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "combat_footprint.h"
#include "map_point.h"

enum t_direction;

// -------------------------------------------------------------------------
// footprint of combat object, marked by cell as to whether a cell is used.
// -------------------------------------------------------------------------
class t_threat_footprint : public t_combat_footprint
{
public:
	t_threat_footprint( int size, t_direction direction, int arc );

	int         get_arc() const;  // in degrees, 180-360 coverage.
	t_direction get_direction() const;

	t_direction const* get_angles() const;
	t_direction const* get_angles( int row ) const;
	t_direction        get_angle( t_map_point_2d const& point ) const;
protected:
	std::vector<t_direction> m_angles;
	int                      m_arc;
	t_direction              m_direction;
};

inline t_direction t_threat_footprint::get_direction() const
{
	return m_direction;
}

inline int t_threat_footprint::get_arc() const
{
	return m_arc;
}

inline t_direction const* t_threat_footprint::get_angles() const
{
	return &(*m_angles.begin());
}

inline t_direction const* t_threat_footprint::get_angles( int row ) const
{
	return &m_angles.at(row * m_size);
}

inline t_direction t_threat_footprint::get_angle( t_map_point_2d const& point ) const
{
	return m_angles[ point.row * m_size + point.column ];
}

t_threat_footprint const& get_threat_footprint( int size, t_direction direction, int arc );

#endif // THREAT_FOOTPRINT_H_INCLUDED